home *** CD-ROM | disk | FTP | other *** search
/ HPAVC / HPAVC CD-ROM.iso / pc / COOLVIEW.ZIP / VIEW50_1.PAS < prev    next >
Encoding:
Pascal/Delphi Source File  |  1995-03-05  |  1.4 KB  |  67 lines

  1. { View 50-lines screen in Text Mode                          }
  2. { Coded '95 by Paradise, 1995.III.3                          }
  3. { Lublin, Poland                                             }
  4. { paradise@bachus.umcs.lublin.pl                             }
  5. {                                                            }
  6. { Example : Load bin screen from file                        }
  7. {                                                            }
  8. { Need : external file as 8000bytes bin file                 }
  9. {                                                            }
  10.  
  11. procedure OpenMode50L; assembler;
  12. asm
  13.   { set 400 scan lines        }
  14.   mov ax, 1202h
  15.   mov bl, 30h
  16.   int 10h
  17.   { set text mode             }
  18.   mov ax, 3h
  19.   int 10h
  20.   { load 8x8 font             }
  21.   mov ax, 1112h
  22.   mov bl, 0
  23.   int 10h
  24. end;
  25.  
  26. procedure CloseMode; assembler;
  27. asm
  28.   mov ax,0003h
  29.   int 10h
  30. end;
  31.  
  32. procedure Error(title: String);
  33. begin
  34.   CloseMode;
  35.   Writeln('Error! ',title,'.');
  36.   Halt;
  37. end;
  38.  
  39. procedure ReadScreen;
  40. var F: File;
  41. begin
  42.   assign(F,'coolview.bin');
  43.   reset(F,1);
  44.   if ioresult<>0 then Error('Disk or file error');
  45.   if filesize(F)<>8000 then
  46.   begin
  47.    close(F);
  48.    Error('Incorrect file size');
  49.   end;
  50.   blockread(F,mem[$B800:0],8000);
  51.   close(F);
  52. end;
  53.  
  54. procedure WaitEsc; assembler;
  55. asm
  56.   @escnopressed:
  57.   in al,60h
  58.   cmp al,1
  59.   jne @escnopressed
  60. end;
  61.  
  62. begin
  63.   OpenMode50L;
  64.   ReadScreen;
  65.   WaitEsc;
  66.   CloseMode;
  67. end.